package com.ssy.lingxi.system.controller;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.system.dto.response.MemberConfigAppraisalItemPageResponse;
import com.ssy.lingxi.system.model.dto.common.CommonStateDTO;
import com.ssy.lingxi.system.service.MemberConfigAppraisalItemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;

/**
 * @menu 会员设置 - 会员考评项目设置
 * @author yzc
 * @version 2.0.0
 * @date 2021/6/3
 */
@Api(tags = "会员考评项目设置")
@RestController
public class MemberConfigAppraisalItemController {

    @Resource
    private MemberConfigAppraisalItemService memberConfigAppraisalItemService;


    @ApiOperation(value = "会员项目考评配置列表")
    @GetMapping("/member/appraisal/item/config/list")
    public Wrapper<List<MemberConfigAppraisalItemPageResponse>> listMemberConfigAppraisalItem() {
        return memberConfigAppraisalItemService.listMemberConfigAppraisalItem();
    }

    @ApiOperation(value = "会员项目考评配置启用/停用")
    @PostMapping("/member/appraisal/item/config/enable")
    public Wrapper<Void> listMemberConfigAppraisalItem(@RequestBody @Valid CommonStateDTO stateDTO) {
        return memberConfigAppraisalItemService.enableMemberConfigAppraisalItem(stateDTO);
    }
}
